package edu.arizona.mindseye;

import java.util.ArrayList;
import java.util.List;

public class Annotation {

	private int _humanId;
	
	private int _min;
	private int _max;
	
	List<String> _behaviors;
	
	public Annotation(int humanId, int min, int max) { 
		super();		
		
		_humanId = humanId;
		
		_min = min;
		_max = max;
		
		_behaviors = new ArrayList<String>();
	}
	
	public int humanId() { 
		return _humanId;
	}
	
	public int min() { 
		return _min;
	}
	
	public int max() { 
		return _max;
	}
	
	public List<String> behaviors() { 
		return _behaviors;
	}
	
	public void add(String activity) { 
		_behaviors.add(activity);
	}
	
	public void set(List<String> behaviors) { 
		_behaviors = new ArrayList<String>(behaviors);
	}
	
	@Override
	public String toString() {
		StringBuilder buf = new StringBuilder("[" + _min + " " + _max + "] ");
		for (int i = 0; i < _behaviors.size(); ++i) { 
			buf.append(_behaviors.get(i) + ",");
		}
		buf.deleteCharAt(buf.length()-1);
		return buf.toString();
	}
	
	public String behaviorsString() { 
		StringBuilder buf = new StringBuilder();
		for (int i = 0; i < _behaviors.size(); ++i) { 
			buf.append(_behaviors.get(i) + ",");
		}
		buf.deleteCharAt(buf.length()-1);
		return buf.toString();
	}
}
